import request from '@/utils/request'

export default {
  getAllChat() {
    return request({
      url: '/chat/all',
      method: 'get'
    })
  },
  addChat(chat) {
    return request({
      url: '/chat',
      method: 'post',
      data: chat
    })
  },
  updateChat(chat) {
    return request({
      url: '/chat',
      method: 'put',
      data: chat
    })
  },
  getChatByTalkId(talkId) {
    return request({
      url: '/chat?talkId=' + talkId,
      method: 'get'
    })
  },
  getChatGroupByTime() {
    return request({
      url: '/chat/time',
      method: 'get'
    })
  }
}
